<script setup lang="ts">
import { computed } from "vue"
import { Tabs, TabsProps } from "ant-design-vue"

export type Props = TabsProps

const props = defineProps<Props>()

const model = defineModel<TabsProps["activeKey"]>()

const slots = defineSlots<InstanceType<typeof Tabs>["$slots"]>()

const computedProps = computed<Omit<Props, "activeKey">>(() => {
  let omit = { ...props }
  delete omit.activeKey
  return omit
})
</script>

<template>
  <Tabs v-model:active-key="model" v-bind="computedProps">
    <template v-for="(_, key) in slots" :key="key" #[key]="params">
      <slot :name="key" :key="key" v-bind="params"></slot>
    </template>
  </Tabs>
</template>
